/*
 * @Author: zhangguowei 974599791@qq.com
 * @Date: 2022-09-27 09:43:49
 * @LastEditors: zhangguowei 974599791@qq.com
 * @LastEditTime: 2022-09-27 16:25:59
 * @Description: pinia入口
 */
import type { AppContext, Plugin } from "vue";
import { createPinia } from "pinia";
// 可持久化插件，实现刷新时数据不丢失
import piniaPluginPersist from "pinia-plugin-persist";

const store = createPinia();

store.use(piniaPluginPersist);

export const setupStore = (app: AppContext["app"]) => {
  app.use(store as Plugin);
};

export { store };
